# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=devicemaster-linux
pkgver=7.34
pkgrel=3
pkgdesc="Userspace tools for NS-Link Device Drivers"
url="https://www.comtrol.com/resources/product-resources-white-papers/ns-link-device-drivers"
arch="all"
license="GPL-2.0-or-later"
makedepends="linux-headers"
options="!check" # no testsuite
subpackages="$pkgname-doc $pkgname-openrc"
source="https://files.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-$pkgver.tar.gz
	makefile.patch
	nslink.initd
	"

build() {
	make nslinkd nslinkadmin nslinkrelease nslinktool
}

package() {
	install -d \
		"$pkgdir"/etc/init.d \
		"$pkgdir"/sbin \
		"$pkgdir"/usr/share/man/man5 \
		"$pkgdir"/usr/share/man/man8
	install -m700 nslinkadmin nslinktool nslinkrelease nslinkd \
		"$pkgdir"/sbin/
	install nslink.conf "$pkgdir"/etc/
	install -m755 "$srcdir"/nslink.initd "$pkgdir"/etc/init.d/nslink

	install -m644 *.8 "$pkgdir"/usr/share/man/man8
	install -m644 *.5 "$pkgdir"/usr/share/man/man5
}

sha512sums="
a7af54fde5812256b4a04f13d41c064dcb7f702cac18e4929d1a9669c49294eb62fc6e55e7b873bae63a795c3148dbca74ab39f337e26962bdee021f5fb2119c  devicemaster-linux-7.34.tar.gz
adadb7b6502b0b6fd2d72a1a453dcea2ff8800d08258b80c5df751bd9fc8de5e88760560c2ab1e911e994999db58882555b5ab6e72f466ed26a47b327f6a668a  makefile.patch
6e67a184ec73d5909d67b7d606d4789cad0e0b4134bb52bfd4019fd7f65b928c15c241dfe6f8a1c6e0854f4d509d7bb150beb9d41ae2a2315ebc040c240abc22  nslink.initd
"
